-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Non poissonian tests #205
Non poissonian tests #205
Conversation
removed unused imports
if random_numbers is None: | ||
random_numbers = numpy.random.rand(num_events) | ||
else: | ||
# TODO: ensure that random numbers are all between 0 and 1. | ||
pass | ||
|
||
# reset simulation array to zero, but don't reallocate | ||
sim_fore.fill(0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bayonato89 @khawajasim can we remove this part of the function? the vector random_numbers
is not used for anything it seems. the simulation below allocates a new array called random_num
. i think we still need to keep the sim_fore.fill(0)
should be included.
csep/core/binomial_evaluations.py
Outdated
if (idx + 1) % 100 == 0: | ||
print(f'... {idx + 1} catalogs simulated.') | ||
|
||
target_idx = numpy.nonzero(catalog.ravel()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this line also doesn't work because the variable catalog is not defined anywhere here. should this be observed_data
?
thanks for this contribution. looks like we're getting really close. i left some comments on this pull request. we still need a test case here to verify that everything is working as we expect. @khawajasim @bayonato89 can you get some test cases for this module? we need to make sure that |
I think I can take care of unit tests for _binary_likelihood_test, _simulate_catalogs in the coming days. |
random_num = numpy.random.uniform(0,1) | ||
loc = numpy.searchsorted(sampling_weights, random_num) | ||
if sim_fore[loc] == 0: | ||
numpy.add.at(sim_fore, loc, 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can be indexed
pyCSEP Pull Request Checklist
Please check out the contributing guidelines for some tips
on making pull requests to pyCSEP.
Fixes issue #(please fill in or delete if not needed).
Type of change:
Please delete options that are not relevant.
Checklist: